package com.hbnu.iostream;

import java.io.IOException;

/**
 * @author kittychen
 * @since 2025-10-11 下午 3:41
 */
public class PipedStreamTest {
    public static void main(String[] args) {
        // 创建线程对象
        Send send = new Send();
        Receive receive = new Receive();

        try {
            send.getPipedOutputStream().connect(receive.getPipedInputStream());
        } catch (IOException e) {
            e.printStackTrace();
        }

        // 启动线程
        new Thread(send).start();
        new Thread(receive).start();
    }
}
